package com.culture.bootdemo.controller.thread;

/**
 * @Author: wen
 * @DateTime: 2024/3/12 14:36
 * @Description:
 **/
public class DemoContext {

    private final ThreadLocal<Integer> productCountThreadLocal = new ThreadLocal<>();

    public Integer getActivityProductCount() {
        return productCountThreadLocal.get();
    }

    public void setActivityProductCount(Integer productCount) {
        productCountThreadLocal.set(productCount);
    }

    public void clear() {
        productCountThreadLocal.remove();
    }

}
